[SUBROUTINE]
version = 1.14
icon = axis-a.png
name = _("A indexing")
type = index-A
help = _("<b>Rotate A axis</b>")
order = act h3 num start fill items

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 0
tool_tip = _("Disabling will NOT disable items")

[PARAM_H3]
type = sub-header
name = _("Parameters")

[PARAM_NUM]
name = _("Number of steps")
type = int
minimum_value = 1
icon = copies.png
tool_tip = _("Number of steps")
value = 4
header = h3

[PARAM_START]
name = _("Start angle")
type = float
digits = 2
icon = angle.png
tool_tip = _("Angle of the first item")
value = 0
header = h3
suffix = &#176;

[PARAM_FILL]
name = _("Fill angle")
type = float
digits = 2
icon = ext-angle.png
tool_tip = _("Angle covered by all items")
value = 360
header = h3
suffix = &#176;

[PARAM_ITEMS]
name = _("Items")
type = items
icon = items.png
tool_tip = _("Items")

[DEFINITIONS]
content =
;	<eval>self.include_once(file name here)</eval>

[BEFORE]
content =
	(begin #sub_name)
	(indexing of A axis author : Fernand Veilleux)
	
	o<#self_id_active_before> if [#param_act]
		
		o<#self_id_fill> if [[[#param_fill MOD 360] NE 0] AND [#param_num GT 1]]
			#<fill#ID> = [#param_fill * #param_num / [#param_num - 1]]
		o<#self_id_fill> else
			#<fill#ID> = #param_fill
		o<#self_id_fill> endif
		
		#<count#ID> = 0
		#<step#ID> = [#<fill#ID> / #param_num]
		
		o<#self_id_repeat> repeat [#param_num]
			G0 A[#param_start + #<step#ID> * #<count#ID>]
			
	o<#self_id_active_before> endif
		
			(begin #sub_name items)

[AFTER]
content =
			(end #sub_name items)
			
	o<#self_id_active_after> if [#param_act]
			#<count#ID> = [#<count#ID> + 1]
		o<#self_id_repeat> endrepeat
		
		G0 A0
		
	o<#self_id_active_after> endif	
	(end #sub_name)
	